package com.ala4.oxcafe.entity;

import com.ala4.oxcafe.core.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 门店信息
 *
 * @author PING
 * @version 1.0.0
 * @date 2025/8/14 14:53
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("store_info")
@Schema(description = "门店信息")
public class StoreInfo extends BaseEntity {

    @Schema(description = "主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @NotNull(message = "ID不能为空", groups = {Update.class})
    private Long id;

    @Schema(description = "门店编码")
    private String storeCode;
    @Schema(description = "门店名称")
    @NotNull(message = "门店名称不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "门店名称不能为空", groups = {Create.class, Update.class})
    private String storeName;
    @Schema(description = "门店类型('直营','加盟','合作')")
    private String storeType;
    @NotNull(message = "地址信息不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "地址信息不能为空", groups = {Create.class, Update.class})
    @Schema(description = "地区编码")
    private String regionCode;
    @NotNull(message = "地址信息不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "地址信息不能为空", groups = {Create.class, Update.class})
    @Schema(description = "地区名称")
    private String regionName;
    @NotNull(message = "详情地址不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "详情地址不能为空", groups = {Create.class, Update.class})
    @Schema(description = "详细地址")
    private String detailAddress;
    @Schema(description = "联系人")
    @NotNull(message = "联系人不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "联系人不能为空", groups = {Create.class, Update.class})
    private String contact;
    @Schema(description = "联系电话")
    @NotNull(message = "联系电话不能为空", groups = {Create.class, Update.class})
    @NotEmpty(message = "联系电话不能为空", groups = {Create.class, Update.class})
    private String contactPhone;
    @Schema(description = "紧急联系电话")
    private String emergencyPhone;
    @Schema(description = "银行账号")
    private String bankAccount;
    @Schema(description = "是否授权(0是 1否)")
    @NotNull(message = "是否授权不能为空", groups = {Create.class, Update.class})
    private Integer isAuthorized;
    @Schema(description = "状态（0正常 1冻结）")
    @NotNull(message = "状态不能为空", groups = {Create.class, Update.class})
    private Integer status;
    @TableField(exist = false)
    @Schema(description = "地址编码模糊查询(左like查询)")
    private String regionCodeLike;

    public interface Create {
    }

    public interface Update {
    }

}
